package cn.lili.modules.promotion.entity.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 全返卷有效时间
 * */
@Getter
public enum ReturnActivityTimeEnum {

    MONTH_ONE("1个月"),
    MONTH_TWO("2个月"),
    MONTH_THREE("3个月"),
    MONTH_FOUR("4个月"),
    MONTH_FIVE("5个月"),
    MONTH_SIX("6个月"),
    MONTH_SEVEN("7个月"),
    MONTH_EIGHT("8个月"),
    MONTH_NINE("9个月"),
    MONTH_TEN("10个月"),
    MONTH_ELEVEN("11个月"),
    YEAR_ONE("一年");


    private final String description;

    ReturnActivityTimeEnum(String str) {
        this.description = str;
    }

    /**
     * 枚举转MAP
     * */
    public static Map<String,String> convertMap(){
        return Arrays.stream(ReturnActivityTimeEnum.values())
                .collect(LinkedHashMap::new,(map, enumValue) -> map.put(enumValue.name(), enumValue.getDescription()), LinkedHashMap::putAll);
    }
}
